/**
 * Created by 1 on 2016/12/9.
 */
var commander = {
	//指挥官笔记本
	notebook:{
		orbitStatus:[false,false,false,false]//各个轨道状态
	},
	//创建飞船
	createSpaceShip:function (orbitId) {
		if(this.notebook.orbitStatus[orbitId]){
			log("轨道" + (orbitId + 1) + "上已经存在飞船","blue");
			return;
		}
		this.notebook.orbitStatus[orbitId] = true;
		log("在轨道" + (orbitId + 1) + "上创建飞船","yellow");
	},
	//开始飞行
	start:function (orbitId) {
		//判断是否存在飞船
		if(!this.notebook.orbitStatus[orbitId]){
			log("轨道" + (orbitId + 1) + "上不存在飞船","blue");
			return;
		}
		log("向轨道" + (orbitId + 1) + "发生开始飞行指令!","yellow");
	},
	//停止飞行
	stop:function (orbitId) {
		//判断是否存在飞船
		if (!this.notebook.orbitStatus[orbitId]){
			log("轨道" + (orbitId + 1) + "上不存在飞船","blue");
			return;
		}
		log("向轨道" + (orbitId + 1) + "发生开始停止飞行指令!","yellow");
	},
	//飞船自爆
	destory:function (orbitId) {
		if(!this.notebook.orbitStatus[orbitId]){
			log("轨道" + (orbitId + 1) + "上不存在飞船","blue");
			return;
		}
		//从记录中删除飞船
		this.notebook.orbitStatus[orbitId] = false;
		log("向轨道" + (orbitId + 1) + "发生销毁指令!","yellow");
	},
	setRate:function (orbitId, rate) {
		//判断该轨道是否含有飞船
		if(!this.notebook.orbitStatus[orbitId]){
			log("轨道" + (orbitId + 1) + "上不存在飞船","blue");
			return;
		}
		log("向轨道" + (orbitId + 1) + "发生速度设置指令!","yellow");
	}
}